package store.domain;

import store.util.Transliterator;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

@Entity
@Table(name = "jos_jshopping_products")
public class Product implements Serializable {
    private Integer productId;
    private Integer parentId;
    private String productEan;
    private Double productQuantity;
    private Byte unlimited;
    private String productAvailability;
    private Timestamp productDateAdded;
    private Timestamp dateModify;
    private Byte productPublish;
    private Byte productTaxId;
    private Integer currencyId;
    private String productTemplate;
    private String productUrl;
    private Double productOldPrice;
    private Double productBuyPrice;
    private Double productPrice;
    private Double minPrice;
    private Byte differentPrices;
    private Double productWeight;
    private String image;
    private Integer productManufacturerId;
    private Byte productIsAddPrice;
    private Integer addPriceUnitId;
    private Float averageRating;
    private Integer reviewsCount;
    private Integer deliveryTimesId;
    private Integer hits;
    private Double weightVolumeUnits;
    private Integer basicPriceUnitId;
    private Integer labelId;
    private Integer vendorId;
    private Integer access;
    private String nameEnGb;
    private String aliasEnGb;
    private String shortDescriptionEnGb;
    private String descriptionEnGb;
    private String metaTitleEnGb;
    private String metaDescriptionEnGb;
    private String metaKeywordEnGb;
    private String nameRuRu;
    private String aliasRuRu;
    private String shortDescriptionRuRu;
    private String descriptionRuRu;
    private String metaTitleRuRu;
    private String metaDescriptionRuRu;
    private String metaKeywordRuRu;

    public Product() {
        parentId = 0;
        productEan = "";
        productQuantity = 1.0;
        unlimited = 0;
        productAvailability = "";
        productDateAdded = new Timestamp(new Date().getTime());
        dateModify = productDateAdded;
        productPublish = 1;
        productTaxId = 2;
        currencyId = 1;
        productTemplate = "default";
        productUrl = "";
        productOldPrice = 0.0;
        productBuyPrice = 0.0;
        productPrice = 0.0;
        minPrice = productPrice;
        differentPrices = 0;
        productWeight = 0.0;
        image = "";
        productManufacturerId = 0;
        productIsAddPrice = 0;
        addPriceUnitId = 0;
        averageRating = (float) 0;
        reviewsCount = 0;
        deliveryTimesId = 0;
        hits = 0;
        weightVolumeUnits = 0.0;
        basicPriceUnitId = 0;
        labelId = 0;
        vendorId = 0;
        access = 1;
        nameEnGb = "";
        aliasEnGb = nameEnGb.toLowerCase();
        shortDescriptionEnGb = "";
        descriptionEnGb = "";
        metaTitleEnGb = "";
        metaDescriptionEnGb = "";
        metaKeywordEnGb = "";
        nameRuRu = "";
        aliasRuRu = Transliterator.toTranslit(nameRuRu.toLowerCase());
        shortDescriptionRuRu = "";
        descriptionRuRu = "";
        metaTitleRuRu = "";
        metaDescriptionRuRu = "";
        metaKeywordRuRu = "";

    }

    @Id
    @GeneratedValue
    @Column(name = "product_id")
    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    @Basic
    @Column(name = "parent_id")
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "product_ean")
    public String getProductEan() {
        return productEan;
    }

    public void setProductEan(String productEan) {
        this.productEan = productEan;
    }

    @Basic
    @Column(name = "product_quantity")
    public Double getProductQuantity() {
        return productQuantity;
    }

    public void setProductQuantity(Double productQuantity) {
        this.productQuantity = productQuantity;
    }

    @Basic
    @Column(name = "unlimited")
    public Byte getUnlimited() {
        return unlimited;
    }

    public void setUnlimited(Byte unlimited) {
        this.unlimited = unlimited;
    }

    @Basic
    @Column(name = "product_availability")
    public String getProductAvailability() {
        return productAvailability;
    }

    public void setProductAvailability(String productAvailability) {
        this.productAvailability = productAvailability;
    }

    @Basic
    @Column(name = "product_date_added")
    public Timestamp getProductDateAdded() {
        return productDateAdded;
    }

    public void setProductDateAdded(Timestamp productDateAdded) {
        this.productDateAdded = productDateAdded;
    }

    @Basic
    @Column(name = "date_modify")
    public Timestamp getDateModify() {
        return dateModify;
    }

    public void setDateModify(Timestamp dateModify) {
        this.dateModify = dateModify;
    }

    @Basic
    @Column(name = "product_publish")
    public Byte getProductPublish() {
        return productPublish;
    }

    public void setProductPublish(Byte productPublish) {
        this.productPublish = productPublish;
    }

    @Basic
    @Column(name = "product_tax_id")
    public Byte getProductTaxId() {
        return productTaxId;
    }

    public void setProductTaxId(Byte productTaxId) {
        this.productTaxId = productTaxId;
    }

    @Basic
    @Column(name = "currency_id")
    public Integer getCurrencyId() {
        return currencyId;
    }

    public void setCurrencyId(Integer currencyId) {
        this.currencyId = currencyId;
    }

    @Basic
    @Column(name = "product_template")
    public String getProductTemplate() {
        return productTemplate;
    }

    public void setProductTemplate(String productTemplate) {
        this.productTemplate = productTemplate;
    }

    @Basic
    @Column(name = "product_url")
    public String getProductUrl() {
        return productUrl;
    }

    public void setProductUrl(String productUrl) {
        this.productUrl = productUrl;
    }

    @Basic
    @Column(name = "product_old_price")
    public Double getProductOldPrice() {
        return productOldPrice;
    }

    public void setProductOldPrice(Double productOldPrice) {
        this.productOldPrice = productOldPrice;
    }

    @Basic
    @Column(name = "product_buy_price")
    public Double getProductBuyPrice() {
        return productBuyPrice;
    }

    public void setProductBuyPrice(Double productBuyPrice) {
        this.productBuyPrice = productBuyPrice;
    }

    @Basic
    @Column(name = "product_price")
    public Double getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(Double productPrice) {
        this.productPrice = productPrice;
    }

    @Basic
    @Column(name = "min_price")
    public Double getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(Double minPrice) {
        this.minPrice = minPrice;
    }

    @Basic
    @Column(name = "different_prices")
    public Byte getDifferentPrices() {
        return differentPrices;
    }

    public void setDifferentPrices(Byte differentPrices) {
        this.differentPrices = differentPrices;
    }

    @Basic
    @Column(name = "product_weight")
    public Double getProductWeight() {
        return productWeight;
    }

    public void setProductWeight(Double productWeight) {
        this.productWeight = productWeight;
    }

    @Basic
    @Column(name = "image")
    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Basic
    @Column(name = "product_manufacturer_id")
    public Integer getProductManufacturerId() {
        return productManufacturerId;
    }

    public void setProductManufacturerId(Integer productManufacturerId) {
        this.productManufacturerId = productManufacturerId;
    }

    @Basic
    @Column(name = "product_is_add_price")
    public Byte getProductIsAddPrice() {
        return productIsAddPrice;
    }

    public void setProductIsAddPrice(Byte productIsAddPrice) {
        this.productIsAddPrice = productIsAddPrice;
    }

    @Basic
    @Column(name = "add_price_unit_id")
    public Integer getAddPriceUnitId() {
        return addPriceUnitId;
    }

    public void setAddPriceUnitId(Integer addPriceUnitId) {
        this.addPriceUnitId = addPriceUnitId;
    }

    @Basic
    @Column(name = "average_rating")
    public Float getAverageRating() {
        return averageRating;
    }

    public void setAverageRating(Float averageRating) {
        this.averageRating = averageRating;
    }

    @Basic
    @Column(name = "reviews_count")
    public Integer getReviewsCount() {
        return reviewsCount;
    }

    public void setReviewsCount(Integer reviewsCount) {
        this.reviewsCount = reviewsCount;
    }

    @Basic
    @Column(name = "delivery_times_id")
    public Integer getDeliveryTimesId() {
        return deliveryTimesId;
    }

    public void setDeliveryTimesId(Integer deliveryTimesId) {
        this.deliveryTimesId = deliveryTimesId;
    }

    @Basic
    @Column(name = "hits")
    public Integer getHits() {
        return hits;
    }

    public void setHits(Integer hits) {
        this.hits = hits;
    }

    @Basic
    @Column(name = "weight_volume_units")
    public Double getWeightVolumeUnits() {
        return weightVolumeUnits;
    }

    public void setWeightVolumeUnits(Double weightVolumeUnits) {
        this.weightVolumeUnits = weightVolumeUnits;
    }

    @Basic
    @Column(name = "basic_price_unit_id")
    public Integer getBasicPriceUnitId() {
        return basicPriceUnitId;
    }

    public void setBasicPriceUnitId(Integer basicPriceUnitId) {
        this.basicPriceUnitId = basicPriceUnitId;
    }

    @Basic
    @Column(name = "label_id")
    public Integer getLabelId() {
        return labelId;
    }

    public void setLabelId(Integer labelId) {
        this.labelId = labelId;
    }

    @Basic
    @Column(name = "vendor_id")
    public Integer getVendorId() {
        return vendorId;
    }

    public void setVendorId(Integer vendorId) {
        this.vendorId = vendorId;
    }

    @Basic
    @Column(name = "access")
    public Integer getAccess() {
        return access;
    }

    public void setAccess(Integer access) {
        this.access = access;
    }

    @Basic
    @Column(name = "`name_en-GB`")
    public String getNameEnGb() {
        return nameEnGb;
    }

    public void setNameEnGb(String nameEnGb) {
        this.nameEnGb = nameEnGb;
    }

    @Basic
    @Column(name = "`alias_en-GB`")
    public String getAliasEnGb() {
        return aliasEnGb;
    }

    public void setAliasEnGb(String aliasEnGb) {
        this.aliasEnGb = aliasEnGb;
    }

    @Basic
    @Column(name = "`short_description_en-GB`")
    public String getShortDescriptionEnGb() {
        return shortDescriptionEnGb;
    }

    public void setShortDescriptionEnGb(String shortDescriptionEnGb) {
        this.shortDescriptionEnGb = shortDescriptionEnGb;
    }

    @Basic
    @Column(name = "`description_en-GB`")
    public String getDescriptionEnGb() {
        return descriptionEnGb;
    }

    public void setDescriptionEnGb(String descriptionEnGb) {
        this.descriptionEnGb = descriptionEnGb;
    }

    @Basic
    @Column(name = "`meta_title_en-GB`")
    public String getMetaTitleEnGb() {
        return metaTitleEnGb;
    }

    public void setMetaTitleEnGb(String metaTitleEnGb) {
        this.metaTitleEnGb = metaTitleEnGb;
    }

    @Basic
    @Column(name = "`meta_description_en-GB`")
    public String getMetaDescriptionEnGb() {
        return metaDescriptionEnGb;
    }

    public void setMetaDescriptionEnGb(String metaDescriptionEnGb) {
        this.metaDescriptionEnGb = metaDescriptionEnGb;
    }

    @Basic
    @Column(name = "`meta_keyword_en-GB`")
    public String getMetaKeywordEnGb() {
        return metaKeywordEnGb;
    }

    public void setMetaKeywordEnGb(String metaKeywordEnGb) {
        this.metaKeywordEnGb = metaKeywordEnGb;
    }

    @Basic
    @Column(name = "`name_ru-RU`")
    public String getNameRuRu() {
        return nameRuRu;
    }

    public void setNameRuRu(String nameRuRu) {
        this.nameRuRu = nameRuRu;
    }

    @Basic
    @Column(name = "`alias_ru-RU`")
    public String getAliasRuRu() {
        return aliasRuRu;
    }

    public void setAliasRuRu(String aliasRuRu) {
        this.aliasRuRu = aliasRuRu;
    }

    @Basic
    @Column(name = "`short_description_ru-RU`")
    public String getShortDescriptionRuRu() {
        return shortDescriptionRuRu;
    }

    public void setShortDescriptionRuRu(String shortDescriptionRuRu) {
        this.shortDescriptionRuRu = shortDescriptionRuRu;
    }

    @Basic
    @Column(name = "`description_ru-RU`")
    public String getDescriptionRuRu() {
        return descriptionRuRu;
    }

    public void setDescriptionRuRu(String descriptionRuRu) {
        this.descriptionRuRu = descriptionRuRu;
    }

    @Basic
    @Column(name = "`meta_title_ru-RU`")
    public String getMetaTitleRuRu() {
        return metaTitleRuRu;
    }

    public void setMetaTitleRuRu(String metaTitleRuRu) {
        this.metaTitleRuRu = metaTitleRuRu;
    }

    @Basic
    @Column(name = "`meta_description_ru-RU`")
    public String getMetaDescriptionRuRu() {
        return metaDescriptionRuRu;
    }

    public void setMetaDescriptionRuRu(String metaDescriptionRuRu) {
        this.metaDescriptionRuRu = metaDescriptionRuRu;
    }

    @Basic
    @Column(name = "`meta_keyword_ru-RU`")
    public String getMetaKeywordRuRu() {
        return metaKeywordRuRu;
    }

    public void setMetaKeywordRuRu(String metaKeywordRuRu) {
        this.metaKeywordRuRu = metaKeywordRuRu;
    }
}
